home *** CD-ROM | disk | FTP | other *** search
- #include <osbind.h>
-
- static long (*shell_p)();
- extern int errno;
-
- static
- read_shell()
- {
- long *_shell_p = (long *) 0x4F6L;
-
- shell_p = (long (*)())(*_shell_p);
- }
-
- static int
- init_system()
- {
- int ret;
-
- Supexec(read_shell);
- if(!(long)shell_p) return(0);
- ret = 1;
- if((*((long *)(((long) shell_p)-10)) == 0x00420135L))
- ret = 2; /* Gulam */
- if((*((long *)(((long) shell_p)-4)) == 0xCDCEC5D2L) || /* Master 5.0 */
- (*((long *)(((long) shell_p)-8)) == 0x4D415354L)) /* Master 5.4 */
- ret = 3; /* Master */
- return(ret);
- }
-
- long
- system(cmd)
- char *cmd;
- {
- if(init_system()) return(errno = (shell_p[0])(cmd));
- return(-1L);
- }
-
- long
- m_getenv(cmd)
- char *cmd;
- {
- extern long getenv();
-
- if(init_system() == 3) return((shell_p[4])(1L,cmd));
- return(getenv(cmd));
- }
-